

def lines(file):
    for line in file:
        yield line
    # yield '\n'

def blocks(file):
    block = []
    for line in lines(file):
        if line.strip():
            block.append(line)
        elif block:
            yield ''.join(block).strip()
            block = []
    # if block:
    #     yield ''.join(block).strip()


if __name__ == '__main__':
    with open('./data/test_input.txt', 'r', encoding='utf-8') as f:
        res = list(lines(f))
    for i, line in enumerate(res, 1):
        print(f"{i}行：{repr(line)}")
